Field of the Invention
The present invention relates to a communication apparatus and a control method thereof.
Description of the Related Art
Conventionally, there is a communication method using an acknowledgement called an ACK when a segment is received in order to ensure communication reliability in packet communication. For example, in TCP/IP widely utilized in Internet communication, it is necessary to manage a segment by a sequence number in an octet unit and to respond using the sequence number of the received segment as an ACK packet. Note that TCP/IP stands for Transmission Control Protocol/Internet Protocol.
In protocol processing of TCP/IP, a network buffer is prepared for packetization and resending processing of communication data. In sending of a TCP/IP packet, user data designated by a socket API send( ) is transferred to the network buffer and divided into MTUs (Maximum Transmission Units). Then, the check sum of the divided data and a pseudo header are calculated, and a TCP/IP packet added with a TCP header and an IP header is generated. If a transmission path is of Ethernet®, an Ethernet frame added with an Ethernet header is generated and sent.
Since a wide area of a memory is accessed to transfer data from a user buffer to a network buffer, and calculate a checksum, if the memory access speed is low, it is impossible to generate a TCP/IP packet at high speed. To increase the rate of TCP/IP packet communication, not CPU transfer but DMA transfer may be utilized or an SRAM that allows higher-speed access may be utilized as a network buffer instead of a DRAM when the data is transferred from the user buffer to the network buffer (Japanese Patent Laid-Open No. 2012-182551 (to be referred to as literature 1 hereinafter)).
Because of limitations on the cost and chip area, however, it is impossible to increase the memory size of the SRAM that allows higher-speed access, and to allocate a data buffer serving as a sufficient network buffer to the SRAM. In literature 1, the speed of sending processing by a specific socket is increased by dividing the network buffer into the DRAM and the SRAM to allocate, and utilizing the network buffer allocated to the SRAM for the specific socket.
In sending of TCP communication, however, resending is needed when an acknowledgement cannot be received within a predetermined time in a protocol. It is therefore impossible to release sent packet data until the acknowledgement is received. The network buffer of the SRAM cannot be released while the acknowledgement cannot be received, so a free area runs out. If the network buffer of the SRAM is not empty, the SRAM cannot be utilized in new sending and the DRAM is utilized instead. This causes a deterioration in high-speed communication.